package com.zmc.product.feign;

import com.zmc.common.domain.es.EsSkuEntity;
import com.zmc.common.domain.query.goods.GoodDetailFeignQuery;
import com.zmc.common.domain.query.goods.GoodSkuSearchFeignQuery;
import com.zmc.common.domain.query.home.*;
import com.zmc.common.domain.vo.good.GoodsDeleteVo;
import com.zmc.common.domain.vo.good.GoodsDownVo;
import com.zmc.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Author：zmc
 * @Date：2024/11/27 19:22
 */

@FeignClient("mall-search")
public interface SearchFeignService {

    /**
     * 商品上架
     */
    @PostMapping("/search/product/up")
    public R productUpToEs(@RequestBody List<EsSkuEntity> skuEsModels);

    /**
     * 下架商品
     */
    @PostMapping("/search/product/down")
    public R productDownToEs(@RequestBody GoodsDownVo vo);

    /**
     * 删除商品
     */
    @PostMapping("/search/product/delete")
    public R productDelete(@RequestBody GoodsDeleteVo vo);

    /**
     * 热卖商品
     */
    @PostMapping("/search/product/hot")
    public R hotGoods(@RequestBody HomeHotFeignQuery query);

    /**
     * 首页大屏搜索
     */
    @PostMapping("/search/product/keyword")
    public R homeGoods(@RequestBody HomeKeywordFeignQuery query);

    /**
     * 按综合搜索
     */
    @PostMapping("/search/product/total")
    public R totalGoods(@RequestBody HomeTotalFeignQuery query);

    /**
     * 按销量搜索
     */
    @PostMapping("/search/product/sale")
    public R saleCountGoods(@RequestBody HomeSaleCountFeignQuery query);

    /**
     * 按价格搜索
     */
    @PostMapping("/search/product/price")
    public R priceGoods(@RequestBody HomeSalePriceFeignQuery query);

    @PostMapping("/search/product/good/detail")
    public R getGoodsDetailBySpuId(@RequestBody GoodDetailFeignQuery query);

    /**
     * 条件查询sku列表
     * */
    @PostMapping("/search/product/sku/list")
    public R skuSearch(@RequestBody GoodSkuSearchFeignQuery query);


}
